﻿@model Siser.Web.Models.Medicion

@{
    ViewBag.Title = "Edit";
}
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />

@*Validación de usuario, para que no se pueda acceder a la página sin estar logueado *@
@if (@User.Identity.Name == "")
{
    Layout = null;
    <div style="width:800px; font-size:2em; height:500px; text-align:center; margin-top:100px" class="division">
    @Html.ActionLink("Ingrese como usuario válido...", "InicioSesion", "Cuenta")
    </div>
}
else
{
<h2>Edit</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

    using (Html.BeginForm())
    {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Medicion</legend>

        @Html.HiddenFor(model => model.Id)

        <div class="editor-label">
            @Html.LabelFor(model => model.Fecha)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Fecha)
            @Html.ValidationMessageFor(model => model.Fecha)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Valor)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Valor)
            @Html.ValidationMessageFor(model => model.Valor)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ValorMicrosivertHora)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ValorMicrosivertHora)
            @Html.ValidationMessageFor(model => model.ValorMicrosivertHora)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PiezaId, "Pieza")
        </div>
        <div class="editor-field">
            @Html.DropDownList("PiezaId", String.Empty)
            @Html.ValidationMessageFor(model => model.PiezaId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Estado)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Estado)
            @Html.ValidationMessageFor(model => model.Estado)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CaracteresControl)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CaracteresControl)
            @Html.ValidationMessageFor(model => model.CaracteresControl)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CaracteresLibres)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CaracteresLibres)
            @Html.ValidationMessageFor(model => model.CaracteresLibres)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.EstadoGabinete)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.EstadoGabinete)
            @Html.ValidationMessageFor(model => model.EstadoGabinete)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
    }

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
}